package app.service.impl;

import app.domain.Repositery;
import app.mapper.RepositeryMapper;
import app.service.RepositeryService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* @author Administrator
* @description 针对表【repositery】的数据库操作Service实现
* @createDate 2025-04-28 21:43:12
*/
@Service
public class RepositeryServiceImpl extends ServiceImpl<RepositeryMapper, Repositery>
    implements RepositeryService{


   public String  MINUS(){

 Repositery query=new Repositery();
  query.setGoods("APPLE");

  Repositery result=   getBaseMapper().selectOne(new LambdaQueryWrapper<>(query));
       result.setNum(result.getNum()-1);
       getBaseMapper().update(result,new LambdaQueryWrapper<Repositery>().eq(Repositery::getGoods,"APPLE"));
     Long num= (result.getNum() - 1);
       return "num: "+num;
   }
}




